<template>
  <el-button v-waves :type="type" :size="size" class="ml-10px" @click="handelAdd">
    <i :class="icon" class="wh-14px mr-6px"></i>
    添加
  </el-button>
</template>

<script setup lang="ts">
  defineOptions({
    name: 'OptionAdd',
  })

  withDefaults(
    defineProps<{
      icon?: string
      size?: string
      text?: string
      type?: string
    }>(),
    {
      text: '添加',
      size: 'default',
      icon: 'i-ep-plus',
      type: 'primary',
    }
  )

  const emits = defineEmits<{
    (e: 'on-add'): void
  }>()

  const handelAdd = () => {
    emits('on-add')
  }
</script>
